﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SmartCity.ProcessEngine.Api.Write.Application.Command.FormNodeConfig;
using SmartCity.ProcessEngine.ErrorCode;

namespace SmartCity.ProcessEngine.Api.Write.Controllers
{
    /// <summary>
    /// 流程节点配置(流转设置管理)控制器
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class NodeCfgController : ControllerBase
    {
        private readonly IMediator mediator;

        public NodeCfgController(IMediator mediator)
        {
            this.mediator = mediator;
        }

        /// <summary>
        /// 批量保存流程节点配置
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost]
        public Task<ApiResult<int>> CreateFormNodeCfg(CreateFormNodeCfgCommand request)
        {
            return mediator.Send(request);
        }
    }
}
